<template>
  <div>
    <p>商品列表</p>
    <ul>
      <li v-for="(item, index) in goodlist" :key="index">
        <router-link :to="'/detail/'+item.name">{{item.name}}</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      goodlist: [
        { name: "iphone", id: "001" },
        { name: "huawei", id: "002" },
        { name: "xiaomi", id: "003" },
      ],
    };
  },
};
</script>

<style scoped>
</style>